from playwright.sync_api import Playwright,sync_playwright
from time import sleep

def run(playwright: Playwright)->None:
    browser=playwright.chromium.launch(headless=False)
    context=browser.new_context()
    page=context.new_page()

    page.goto('https://www.jiuxian.com/')

    page.locator('xpath=/html/body/div[2]/div/div[1]/div/a[1]').click()
    sleep(3)
    page.locator('[id="userName"]').fill('15651193747')
    page.locator('[id="password"]').fill('Lfc20041117')
    sleep(7)
    page.locator('xpath=//*[@id="save"]').click()
    sleep(3)
    page.locator('xpath=//*[@id="bindSub"]').click()
    sleep(5)
    page.locator('[id="wd"]').fill('剑南春')
    sleep(2)
    page.locator('.search-btn').click()
    sleep(3)
    page.locator('xpath=/html/body/div[6]/div/div[2]/div[5]/ul/li[1]/div[2]/div[3]/a').click()
    sleep(3)

with sync_playwright() as p:
    run(p)